/**
 * FileFind - ftp/shares indexing and search php engine
 * Module: persist-jpa20
 * Description: Persistence implementation with JPA 2.0
 * Copyright (c) 2003-2010 Rage Steel, www.gt2.ru
 */
package ru.ffind.persist.jpa20.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;
import javax.persistence.Temporal;

import ru.ffind.common.model.Entry;

/**
 * Abstract implementation for Entry.
 *
 * @author Rage Steel
 */
@MappedSuperclass
public abstract class EntryImpl implements Entry, Serializable {

	private static final long serialVersionUID = -322308122648729521L;

	private Integer id;

    private DirImpl parent;

    private HostImpl host;

    private String name;

    private Date datetime;

    @Id
    @Column
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }
    
    @ManyToOne
    public DirImpl getParent() {
        return parent;
    }

    public void setParent(DirImpl parent) {
        this.parent = parent;
    }

    @ManyToOne
    @JoinColumn(name = "host_id")
    public HostImpl getHost() {
        return host;
    }

    public void setHost(HostImpl host) {
        this.host = host;
    }

	@Override
	@Column
	public String getName() {
		return name;
	}

    public void setName(String name) {
        this.name = name;
    }
	
    @Override
    @Column
    @Temporal(javax.persistence.TemporalType.TIMESTAMP)
    public Date getDatetime() {
        return datetime;
    }

    public void setDatetime(Date datetime) {
        this.datetime = datetime;
    }
	
    @Override
    public String getAbsPath(String parentAbsPath) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public boolean equalsMetadata(Entry entry) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

}
